package com.jiyun.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.jiyun.model.pojo.Feedback;
import com.jiyun.model.query.FeedbackQuery;
import com.jiyun.service.FeedbackService;
import com.jiyun.mapper.FeedbackMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author Administrator
* @description 针对表【feedback】的数据库操作Service实现
* @createDate 2025-01-18 09:34:14
*/
@Service
public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper, Feedback>
    implements FeedbackService{
    @Override
    public IPage<Feedback> getPageList(FeedbackQuery query){
        //1.创建查询条件
        QueryWrapper<Feedback> qw = new QueryWrapper<>();
        //ToDo 查询条件

        //2.组件分页数据
        IPage<Feedback> page = new Page<>(query.getCurrentPage(), query.getPageSize());
        //3.查询
        baseMapper.selectPage(page,qw);
        //4.返回
        return page;
    }

    @Autowired
    private FeedbackMapper feedbackMapper;

    @Override
    public void deleteById(Integer id) {
        feedbackMapper.deleteByUserId(id);
    }
}




